package com.st.mall.util.controller;

import java.util.List;

import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.st.mall.util.model.AddrTolModel;
import com.st.mall.util.service.impl.AddrTolServiceImpl;

@Controller
@RequestMapping("/addrtol")
public class AddrTolController {
	
	@Autowired
	private AddrTolServiceImpl service;
	
	@ResponseBody
	@RequestMapping(value="/get" ,produces = "application/json;charset=utf-8")
	public String get(String parentCode) {
		List<AddrTolModel> list = service.select(parentCode);
		return new JSONArray(list).toString(); 
	}
	
	@ResponseBody
	@RequestMapping(value="/updget" ,produces = "application/json;charset=utf-8")
	public String updget(String parentCode) {
		List<AddrTolModel> list = service.select(parentCode);
		return new JSONArray(list).toString(); 
	}
}
